import axios from "axios";
import {reactive} from "vue";


export default function () {
    const dogList = reactive<Array<string>>([]);

    async function addDog() {
        try {
            const result = await axios.get('https://dog.ceo/api/breed/pembroke/images/random');
            dogList.push(result.data.message);
        } catch (error : axiosError) {
            alert(error);
        }
    }
    return {dogList, addDog};
}